package com.coincalf.web;

import com.coincalf.framework.http.Response;
import com.coincalf.service.ConfigService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
@Slf4j
@Api(value = "配置信息", description = "配置信息")
public class ConfigController {

    @Autowired
    private ConfigService configService;

    @GetMapping("/getConfig")
    public Object getConfig(@Param("type") String type, @Param("code") String code) {
        return Response.ok(configService.queryByTypeAndCode(type, code));
    }

}
